Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[metrics] Fix lost connection when metrics query database #3852

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

wing2fly
Copy link
Collaborator

What changes were proposed in this pull request?

Lost connection happens in Django when using multiprocessing or other parallel execution methods. It often occurs because MySQL connections are not shared safely between processes or threads, leading to disconnections or dropped connections during execution. Metrics use multiprocessing when we started Gunicorn server.

How was this patch tested?

Manually tested on DC cluster

Please review Hue Contributing Guide before opening a pull request.

Copy link
Collaborator

@quadoss quadoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wing2fly , The changes look good but there are test failures, please check.

Copy link
Collaborator

@Harshg999 Harshg999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this up!

apps/useradmin/src/useradmin/metrics.py Show resolved Hide resolved
apps/useradmin/src/useradmin/metrics.py Show resolved Hide resolved
desktop/core/src/desktop/metrics.py Show resolved Hide resolved
desktop/core/src/desktop/metrics.py Show resolved Hide resolved
Copy link
Collaborator

@athithyaaselvam athithyaaselvam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@quadoss quadoss merged commit 9111b91 into master Sep 24, 2024
5 of 6 checks passed
@quadoss quadoss deleted the metrics_db_conn branch September 24, 2024 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants